<?php
/*
	TrixBi v0.01
	small billing for Trixbox
	GNU GPL v2
*/
class mySQL {
	private $myConnect;
	private $myServer;
	private $myDatabase;
	private $myUser;
	private $myPasswd;
	private $_myOut;
	private $__myOut;
	
	function __construct(){
		$this->myServer = $myServer;
		$this->myUser = $myUser;
		$this->myPasswd = $myPasswd;
		$this->myConnect = $myConnect;
		$this->myConf = parse_ini_file("conf/trixbi.conf.php");
		if( !($this->myConnect = mysql_connect($this->myConf['Server'], $this->myConf['User'], $this->myConf['Passwd'])) )
			return FALSE;
	}
	/*function __destruct(){
		mysql_close($this->myConnect);
	}*/
	
	/*function myQuery(string $QureyString, string $DatabaseName, bool $QueryTypeFlag 'default=>FALES')*/
	function myQuery($myIn, $myDB, $flag = FALSE){
		$this->myIn = $myIn;
		$this->myOut = $myOut;
		$this->myDB = $myDB;
		$this->flag = $flag;
		
		mysql_selectdb($this->myDB);
		mysql_query("SET NAMES utf8");
		if($this->flag){
			$this->__myOut=mysql_query($this->myIn);
			while($this->_myOut = mysql_fetch_assoc($this->__myOut))
			$this->myOut[] = $this->_myOut;
			return $this->myOut;
		}
		else 
			mysql_query($this->myIn);
		return $this->myOut;
	}
}
?>
